# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_UnifiedCallAsset do
  @moduledoc """
  A unified call asset.

  ## Attributes

  *   `adScheduleTargets` (*type:* `list(GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_AdScheduleInfo.t)`, *default:* `nil`) - List of non-overlapping schedules specifying all time intervals for which the asset may serve. There can be a maximum of 6 schedules per day, 42 in total.
  *   `callConversionAction` (*type:* `String.t`, *default:* `nil`) - The conversion action to attribute a call conversion to. If not set, the default conversion action is used. This field only has effect if call_conversion_reporting_state is set to USE_RESOURCE_LEVEL_CALL_CONVERSION_ACTION.
  *   `callConversionReportingState` (*type:* `String.t`, *default:* `nil`) - Output only. Indicates whether this CallAsset should use its own call conversion setting, follow the account level setting, or disable call conversion.
  *   `callOnly` (*type:* `boolean()`, *default:* `nil`) - Whether the call only shows the phone number without a link to the website. Applies to Microsoft Ads.
  *   `callTrackingEnabled` (*type:* `boolean()`, *default:* `nil`) - Whether the call should be enabled on call tracking. Applies to Microsoft Ads.
  *   `countryCode` (*type:* `String.t`, *default:* `nil`) - Two-letter country code of the phone number. Examples: 'US', 'us'.
  *   `endDate` (*type:* `String.t`, *default:* `nil`) - Last date of when this asset is effective and still serving, in yyyy-MM-dd format.
  *   `phoneNumber` (*type:* `String.t`, *default:* `nil`) - The advertiser's raw phone number. Examples: '1234567890', '(123)456-7890'
  *   `startDate` (*type:* `String.t`, *default:* `nil`) - Start date of when this asset is effective and can begin serving, in yyyy-MM-dd format.
  *   `useSearcherTimeZone` (*type:* `boolean()`, *default:* `nil`) - Whether to show the call extension in search user's time zone. Applies to Microsoft Ads.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :adScheduleTargets =>
            list(GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_AdScheduleInfo.t())
            | nil,
          :callConversionAction => String.t() | nil,
          :callConversionReportingState => String.t() | nil,
          :callOnly => boolean() | nil,
          :callTrackingEnabled => boolean() | nil,
          :countryCode => String.t() | nil,
          :endDate => String.t() | nil,
          :phoneNumber => String.t() | nil,
          :startDate => String.t() | nil,
          :useSearcherTimeZone => boolean() | nil
        }

  field(:adScheduleTargets,
    as: GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_AdScheduleInfo,
    type: :list
  )

  field(:callConversionAction)
  field(:callConversionReportingState)
  field(:callOnly)
  field(:callTrackingEnabled)
  field(:countryCode)
  field(:endDate)
  field(:phoneNumber)
  field(:startDate)
  field(:useSearcherTimeZone)
end

defimpl Poison.Decoder,
  for: GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_UnifiedCallAsset do
  def decode(value, options) do
    GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_UnifiedCallAsset.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_UnifiedCallAsset do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
